<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Struct current_view</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../../../boost_process/v2.html#header.boost.process.v2.environment_hpp" title="Header &lt;boost/process/v2/environment.hpp&gt;">
<link rel="prev" href="../default_process_launcher.html" title="Type definition default_process_launcher">
<link rel="next" href="current_view/iterator.html" title="Struct iterator">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../default_process_launcher.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../boost_process/v2.html#header.boost.process.v2.environment_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="current_view/iterator.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.process.v2.environment.current_view"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct current_view</span></h2>
<p>boost::process::v2::environment::current_view — A view object for the current environment of this process. </p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../boost_process/v2.html#header.boost.process.v2.environment_hpp" title="Header &lt;boost/process/v2/environment.hpp&gt;">boost/process/v2/environment.hpp</a>&gt;

</span>
<span class="keyword">struct</span> <a class="link" href="current_view.html" title="Struct current_view">current_view</a> <span class="special">{</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">environment</span><span class="special">::</span><span class="identifier">native_handle_type</span> <a name="boost.process.v2.environment.current_view.native_handle_type"></a><span class="identifier">native_handle_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <a class="link" href="key_value_pair_view.html" title="Struct key_value_pair_view">key_value_pair_view</a>             <a name="boost.process.v2.environment.current_view.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>        

  <span class="comment">// member classes/structs/unions</span>

  <span class="keyword">struct</span> <a class="link" href="current_view/iterator.html" title="Struct iterator">iterator</a> <span class="special">{</span>
    <span class="comment">// types</span>
    <span class="keyword">typedef</span> <a class="link" href="key_value_pair_view.html" title="Struct key_value_pair_view">key_value_pair_view</a>       <a class="link" href="current_view/iterator.html#boost.process.v2.environment.current_view.iterator.value_type"><span class="identifier">value_type</span></a><span class="special">;</span>       
    <span class="keyword">typedef</span> <span class="keyword">int</span>                       <a class="link" href="current_view/iterator.html#boost.process.v2.environment.current_view.iterator.difference_type"><span class="identifier">difference_type</span></a><span class="special">;</span>  
    <span class="keyword">typedef</span> <a class="link" href="key_value_pair_view.html" title="Struct key_value_pair_view">key_value_pair_view</a>       <a class="link" href="current_view/iterator.html#boost.process.v2.environment.current_view.iterator.reference"><span class="identifier">reference</span></a><span class="special">;</span>        
    <span class="keyword">typedef</span> <a class="link" href="key_value_pair_view.html" title="Struct key_value_pair_view">key_value_pair_view</a>       <a class="link" href="current_view/iterator.html#boost.process.v2.environment.current_view.iterator.pointer"><span class="identifier">pointer</span></a><span class="special">;</span>          
    <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">forward_iterator_tag</span> <a class="link" href="current_view/iterator.html#boost.process.v2.environment.current_view.iterator.iterator_category"><span class="identifier">iterator_category</span></a><span class="special">;</span>

    <span class="comment">// <a class="link" href="current_view/iterator.html#boost.process.v2.environment.current_view.iteratorconstruct-copy-destruct">construct/copy/destruct</a></span>
    <a class="link" href="current_view/iterator.html#idm7009-bb"><span class="identifier">iterator</span></a><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
    <a class="link" href="current_view/iterator.html#idm7010-bb"><span class="identifier">iterator</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="current_view/iterator.html" title="Struct iterator">iterator</a> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
    <a class="link" href="current_view/iterator.html#idm7014-bb"><span class="identifier">iterator</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">native_iterator</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

    <span class="comment">// <a class="link" href="current_view/iterator.html#idm6997-bb">public member functions</a></span>
    <a class="link" href="current_view/iterator.html" title="Struct iterator">iterator</a> <span class="special">&amp;</span> <a class="link" href="current_view/iterator.html#idm6998-bb"><span class="keyword">operator</span><span class="special">++</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
    <a class="link" href="current_view/iterator.html" title="Struct iterator">iterator</a> <a class="link" href="../../../circular_buffer_sp_idm5277.html#idm7001-bb"><span class="keyword">operator</span><span class="special">++</span></a><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">;</span>
    <a class="link" href="key_value_pair_view.html" title="Struct key_value_pair_view">key_value_pair_view</a> <a class="link" href="current_view/iterator.html#idm7006-bb"><span class="keyword">operator</span><span class="special">*</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="special">}</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="current_view.html#boost.process.v2.environment.current_viewconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="current_view.html#idm7031-bb"><span class="identifier">current_view</span></a><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
  <a class="link" href="current_view.html#idm7032-bb"><span class="identifier">current_view</span></a><span class="special">(</span><a class="link" href="current_view.html" title="Struct current_view">current_view</a> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="current_view.html#idm7022-bb">public member functions</a></span>
  <span class="identifier">native_handle_type</span> <a class="link" href="current_view.html#idm7023-bb"><span class="identifier">native_handle</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="current_view/iterator.html" title="Struct iterator">iterator</a> <a class="link" href="../../../container/devector.html#idm7025-bb"><span class="identifier">begin</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <a class="link" href="current_view/iterator.html" title="Struct iterator">iterator</a> <a class="link" href="current_view.html#idm7028-bb"><span class="identifier">end</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.29.12.8.5.3.4"></a><h2>Description</h2>
<p>The view might (windows) or might not (posix) be owning; if it owns it will deallocate the on destruction, like a unique_ptr.</p>
<p>Note that accessing the environment in this way is not thread-safe.</p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">dump_my_env</span><span class="special">(</span><span class="identifier">current_view</span> <span class="identifier">env</span> <span class="special">=</span> <span class="identifier">current</span><span class="special">(</span><span class="special">)</span><span class="special">)</span>
<span class="special">{</span>
   <span class="keyword">for</span> <span class="special">(</span><span class="keyword">auto</span>  <span class="special">&amp;</span> <span class="special">[</span><span class="identifier">k</span><span class="special">,</span> <span class="identifier">v</span><span class="special">]</span> <span class="special">:</span> <span class="identifier">env</span><span class="special">)</span>
       <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">k</span><span class="special">.</span><span class="identifier">string</span><span class="special">(</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="string">" = "</span>  <span class="special">&lt;&lt;</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">string</span><span class="special">(</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
</pre>
<p> </p>
<div class="refsect2">
<a name="id-1.3.29.12.8.5.3.4.5"></a><h3>
<a name="boost.process.v2.environment.current_viewconstruct-copy-destruct"></a><code class="computeroutput">current_view</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idm7031-bb"></a><span class="identifier">current_view</span><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a name="idm7032-bb"></a><span class="identifier">current_view</span><span class="special">(</span><a class="link" href="current_view.html" title="Struct current_view">current_view</a> <span class="special">&amp;&amp;</span> nt<span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.29.12.8.5.3.4.6"></a><h3>
<a name="idm7022-bb"></a><code class="computeroutput">current_view</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><span class="identifier">native_handle_type</span> <a name="idm7023-bb"></a><span class="identifier">native_handle</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="current_view/iterator.html" title="Struct iterator">iterator</a> <a name="idm7025-bb"></a><span class="identifier">begin</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="current_view/iterator.html" title="Struct iterator">iterator</a> <a name="idm7028-bb"></a><span class="identifier">end</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2006-2012 Julio M. Merino Vidal, Ilya Sokolov,
      Felipe Tanus, Jeff Flinn, Boris Schaeling<br>Copyright © 2016 Klemens D. Morgenstern<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../default_process_launcher.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../boost_process/v2.html#header.boost.process.v2.environment_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="current_view/iterator.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
